recoverSuspend

inline suspend fun <R, T : R> Result<T>.recoverSuspend(crossinline transform: suspend (exception: Throwable) -> R): Result<R>

Recovers from a failure by executing transform to create a new value if the Result is a failure.

Return

Result representing the recovered value or original success based on the current Result state.

Parameters

transform

A suspend function to transform the exception on failure.